﻿using NHibernate;
using NHibernate.Cfg;


namespace Yala.UnitTest {
    public static class NhFactory {

        public static ISessionFactory CreateSessionFactory() {
            //Need this if using NhProfiler
            //NHibernateProfiler.Initialize();

            var cfg = new Configuration().Configure();
            cfg.SetProperty(NHibernate.Cfg.Environment.ConnectionStringName, System.Environment.MachineName);
            return cfg.BuildSessionFactory();
        }
    }
}
